function filterData(oldData, newData) {
  const mixData = {}
  if (oldData.taskName !== newData.taskName) {
    mixData.taskName = newData.taskName;
  }
  const roadConditionRoads = []
  for (let i = 0; i < oldData.roadConditionRoads.length; i++) {
    if (newData.roadConditionRoads[i].delete === null) {
      const obj = {}
      if (newData.roadConditionRoads[i].roadName !== oldData.roadConditionRoads[i].roadName || newData.roadConditionRoads[i].roadDirection !== oldData.roadConditionRoads[i].roadDirection || newData.roadConditionRoads[i].geoJson !== oldData.roadConditionRoads[i].geoJson || newData.roadConditionRoads[i].remarks !== oldData.roadConditionRoads[i].remarks) {
        obj.roadConditionRoadId = newData.roadConditionRoads[i].roadConditionRoadId
        if (newData.roadConditionRoads[i].roadName !== oldData.roadConditionRoads[i].roadName) {
          obj.roadName = newData.roadConditionRoads[i].roadName
        }
        if (newData.roadConditionRoads[i].roadDirection !== oldData.roadConditionRoads[i].roadDirection) {
          obj.roadDirection = newData.roadConditionRoads[i].roadDirection
        }
        if (newData.roadConditionRoads[i].geoJson !== oldData.roadConditionRoads[i].geoJson) {
          obj.geoJson = newData.roadConditionRoads[i].geoJson
        }
        if (newData.roadConditionRoads[i].remarks !== oldData.roadConditionRoads[i].remarks) {
          obj.remarks = newData.roadConditionRoads[i].remarks
        }
        if (obj.remarks === null) {
          delete obj.remarks
        }
      }
      const arr = []
      for (let j = 0; j < newData.roadConditionRoads[i].roadTravelRuleList.length; j++) {
        const obj2 = {}
        if (newData.roadConditionRoads[i].roadTravelRuleList[j].travelStatus !== oldData.roadConditionRoads[i].roadTravelRuleList[j].travelStatus || newData.roadConditionRoads[i].roadTravelRuleList[j].vehicleType !== oldData.roadConditionRoads[i].roadTravelRuleList[j].vehicleType) {
          obj2.roadConditionRoadId = newData.roadConditionRoads[i].roadTravelRuleList[j].roadConditionRoadId
          obj2.roadConditionTravelRuleId = newData.roadConditionRoads[i].roadTravelRuleList[j].roadConditionTravelRuleId
          if (newData.roadConditionRoads[i].roadTravelRuleList[j].travelStatus !== oldData.roadConditionRoads[i].roadTravelRuleList[j].travelStatus) {
            obj2.travelStatus = newData.roadConditionRoads[i].roadTravelRuleList[j].travelStatus
          }
          if (newData.roadConditionRoads[i].roadTravelRuleList[j].vehicleType !== oldData.roadConditionRoads[i].roadTravelRuleList[j].vehicleType) {
            obj2.vehicleType = newData.roadConditionRoads[i].roadTravelRuleList[j].vehicleType
          }
        }
        if (Object.keys(obj2).length) {
          arr.push(obj2)
        }
      }
      if (arr.length) {
        obj.roadTravelRuleList = arr
        obj.roadConditionRoadId = newData.roadConditionRoads[i].roadConditionRoadId
      }
      if (Object.keys(obj).length)
        roadConditionRoads.push(obj)
    } else {
      const obj = {}
      obj.roadConditionRoadId = newData.roadConditionRoads[i].roadConditionRoadId
      obj.delete = 1
      roadConditionRoads.push(obj)
    }
  }
  if (newData.roadConditionRoads.length > oldData.roadConditionRoads.length) {
    for (let i = oldData.roadConditionRoads.length; i < newData.roadConditionRoads.length; i++) {
      roadConditionRoads.push(newData.roadConditionRoads[i])
    }
  }
  mixData.roadConditionRoads = roadConditionRoads
  if (mixData.taskName || mixData.roadConditionRoads.length) {
    mixData.roadConditionTaskId = newData.roadConditionTaskId
  }
  return mixData
}
